package cn.kgc.mapper;

import cn.kgc.pojo.Houserole;
import cn.kgc.pojo.HouseroleExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface HouseroleMapper {
    int countByExample(HouseroleExample example);

    int deleteByExample(HouseroleExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Houserole record);

    int insertSelective(Houserole record);

    List<Houserole> selectByExample(HouseroleExample example);

    Houserole selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Houserole record, @Param("example") HouseroleExample example);

    int updateByExample(@Param("record") Houserole record, @Param("example") HouseroleExample example);

    int updateByPrimaryKeySelective(Houserole record);

    int updateByPrimaryKey(Houserole record);

    //查询已分配角色
    public List<Houserole> getAssignedRoleList(Integer userId);

    //查询未分配角色
    public List<Houserole> getUnAssignedRoleList(Integer userId);

    //根据adminId删除角色关系
    public void deletAdminRelationRole(Integer userId);

    //添加角色关系
    public void insertAdminRelationRole(@Param("userId") Integer userId,
                                        @Param("roleIdList") List<Integer> roleIdList);
}